import 'dart:async';

import 'package:flutter_base_framework/base_framework_export.dart';
import 'package:get/get.dart';

mixin OnPageAnimComplete<T extends BasePage> on BaseState<T> {
  //页面是否完全进入
  final pageIsEnter = false.obs;

  @override
  void initState() {
    super.initState();
    // 页面动画完成
    onPageAnimComplete().then((_) {
      Future.microtask(() {
        pageIsEnter.value = true;
        onPageAnimEnd();
      });
    });
  }

  void onPageAnimEnd() {}
}
mixin OnVmPageAnimComplete on BaseViewModel {
  //页面是否完全进入
  final pageIsEnter = false.obs;

  @override
  void onCreate() {
    super.onCreate();
    // 页面动画完成
    onPageAnimComplete().then((_) {
      pageIsEnter.value = true;
      onPageAnimEnd();
    });
  }

  void onPageAnimEnd() {}
}
